package empstest;

import edu.rjxy.xjdx.emps.common.domain.Employee;
import edu.rjxy.xjdx.emps.common.utils.MyDbUtil;

import java.util.List;

public class MydbutilsTest {
    public static void main(String[] args) {
       /* String sql = " select * from employee where id >= ? and id <=? ";
        List<Employee> employees = MyDbUtil.executeQuery(Employee.class, sql, 2, 4);
        for (Employee employee : employees) {
            System.out.println(employee);
        }*/
       // 把id=3的员工姓名改成 汪汪
      /*  String sql = " update employee set name = ? where id = ? ";
        MyDbUtil.executeUpdate(sql,"汪汪",3);
        System.out.println("OK");*/

//      插入 108个好汉，都是一些员工
        String sql = "insert into employee(`name`,`personNumber`,`sex`,`sal`) values(?,?,?,?)";
        for (int i = 1; i <108 ; i++) {
            MyDbUtil.executeUpdate(sql,"黄"+i,"ppNo-"+i,(Math.random()>=0.5?"男":"女"),(int)(Math.random()*10000)/100.0);
        }
        System.out.println("ok");

    }


}
